package com.example.demo.web.servlet;


import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.SecurityUtils;

/**
 * 
 * <p>@author Henry.Y</p>
 *
 * <p>@date 2019-07-27</p>
 */
//@WebServlet(name="logoutServlet",urlPatterns="/logout")
public class LogoutServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID= 2811343017410111226L;

	protected void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
		SecurityUtils.getSubject().logout();
		request.getRequestDispatcher("/WEB-INF/jsp/logoutSuccess.jsp").forward(request, response);
	}
}
